/*
 * debug.h
 *
 *  Created on: 2016-11-10
 *      Author: m
 */

#ifndef SRC_INCLUDE_KERNEL_DEBUG_H_
#define SRC_INCLUDE_KERNEL_DEBUG_H_

#define NG_ACT_HALT     (0x1)

#define assert(exp) if(!(exp)){assert_failed(#exp, __FILE__, __LINE__);}
#define assert_eq_i(expect, real) if(expect != real){assert_eq_failed_i(__FILE__, __LINE__, real, expect);}

// !!! NEVER use in user's Proc
#define assert_a(exp, ng_action) if(!(exp)){assert_failed_a(#exp, __FILE__, __LINE__, ng_action);}
// !!! NEVER use in user's Proc

void assert_failed(char* exp, char* fn, int line);
void assert_eq_failed_i(char* fn, int line, int real, int expect);
void assert_failed_a(char* exp, char* fn, int line, int ng_action);

#endif /* SRC_INCLUDE_KERNEL_DEBUG_H_ */
